Spiking neural network

ABSTRACT

Disclosed herein are system, method, and computer program product embodiments for an improved spiking neural network (SNN) configured to learn and perform unsupervised extraction of features from an input stream. An embodiment operates by receiving a set of spike bits corresponding to a set synapses associated with a spiking neuron circuit. The embodiment applies a first logical AND function to a first spike bit in the set of spike bits and a first synaptic weight of a first synapse in the set of synapses. The embodiment increments a membrane potential value associated with the spiking neuron circuit based on the applying. The embodiment determines that the membrane potential value associated with the spiking neuron circuit reached a learning threshold value. The embodiment then performs a Spike Time Dependent Plasticity (STDP) learning function based on the determination that the membrane potential value of the spiking neuron circuit reached the learning threshold value.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is a continuation of U.S. patent application Ser. No.16/670,368, filed on Oct. 31, 2019, which claims the benefit of U.S.Provisional Application No. 62/754,348, filed on Nov. 1, 2018, titled“An Improved Spiking Neural Network,” all of which are herebyincorporated by reference in their entirety for all purposes.

FIELD

The present approach generally relates to neural circuit engineeringand, more particularly, to a system and method for a low-power highdensity autonomous learning artificial neural network on a chip.

BACKGROUND

It has long been a goal for artificial neural networks to replicate thefunction of the biological neural network (the brain), with limitedsuccess. Brute force hardware approaches to the design of an artificialneural network have been cumbersome and inadequate, and fall far shownof the desired goal of replicating the functionality of the human brain.Thus, a need exists for an approach that enables an autonomous,reconfigurable spiking neural network to be realized that can scale tovery large networks, yet fit on a chip while rapidly making inferencesfrom a wide variety of possible input data and/or sensor sources.

SUMMARY

Provided herein are system, apparatus, article of manufacture, methodand/or computer program product embodiments, and/or combinations andsub-combinations thereof, for an improved spiking neural network (SNN)configured to learn and perform unsupervised extraction of features froman input stream. Some embodiments include a neuromorphic integratedcircuit comprising a spike converter, a reconfigurable neuron fabric, amemory, and a processor. The spike converter is configured to generatespikes from input data. The reconfigurable neuron fabric comprises aneural processor comprising a plurality of spiking neuron circuits. Thespiking neuron circuits are configured to perform a task based on thespikes received from the spike converter and a neural networkconfiguration. The memory comprises the neural network configurationwhich comprises a potential array and a plurality of synapses. Theneural network configuration further defines connections between theplurality of spiking neuron circuits and the plurality of synapses. Theprocessor is configured to modify the neural network configuration basedon a configuration file.

Also described herein are embodiments for learning and performingunsupervised extraction of features from an input stream. Someembodiments operate to receive, at a spiking neuron circuit, a set ofspike bits corresponding to a set of synapses. The spiking neuroncircuit applies a logical AND function to a spike bit in the set ofspike bits and a synaptic weight of a synapse in the set of synapses.The spiking neuron circuit increments a membrane potential value basedon applying the logical AND function. A neural processor then determinesthat the membrane potential value associated with the spiking neuroncircuit reached a learning threshold value. The neural processor thenperforms a Spike Time Dependent Plasticity (STDP) learning functionbased on the determination that the membrane potential value of thespiking neuron circuit reached the learning threshold value.

This Summary is provided merely for purposes of illustrating someexample embodiments to provide an understanding of the subject matterdescribed herein. Accordingly, the above-described features are merelyexamples and should not be construed to narrow the scope or spirit ofthe subject matter in this disclosure. Other features, aspects, andadvantages of this disclosure will become apparent from the followingDetailed Description, Figures, and Claims.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are incorporated herein and form a part of thespecification.

FIG. 1 is a block diagram of a neural model, according to someembodiments.

FIG. 2A is a block diagram of a neuromorphic integrated circuit,according to some embodiments.

FIG. 2B is a block diagram of the neuromorphic integrated circuit inFIG. 2A, according to some embodiments.

FIG. 3 is a flow diagram of input spike buffering, packetizing, andoutput spike buffering for a next layer, according to some embodiments.

FIG. 4 is a block diagram of a neural processor configured as a spikingconvolutional neural processor, according to some embodiments.

FIG. 5 is a block diagram of a neural processor configured as a spikingfully connected neural processor, according to some embodiments.

FIG. 6A is an example of packetizing spikes into a spike packet,according to some embodiments.

FIG. 6B is an example representation of a spike packet in FIG. 6A,according to some embodiments.

FIG. 7 is an example of a method of selecting which bits increment ordecrement a membrane potential counter, according to some embodiments.

FIG. 8 illustrates a weight swapping step of the STDP learning method,according to some embodiments.

FIG. 9 illustrates a method of convolution used in a spikingconvolutional neural processor, according to some embodiments.

FIG. 10 illustrates a symbolic representation of a convolution in an 8by 8 matrix of pixels of depth 1, according to some embodiments.

FIG. 11 illustrates a symbolic representation of a convolution involving2 channels of spikes, two 3 by 3 inverse convolution kernels, andresulting membrane potential values, according to some embodiments.

FIG. 12 illustrates the resulting spikes generated in neurons on channel1 and channel 2 of FIG. 11 , according to some embodiments.

FIG. 13 illustrates a spiking neural network convolution operation,according to some embodiments.

FIG. 14 illustrates the result of eight directional filter neuronconvolutions being applied to an input image, according to someembodiments.

FIG. 15 illustrates the similarity between DVS spike-based convolutionand frame-based convolution, according to some embodiments.

FIG. 16 illustrates an example of a YAML configuration file, accordingto some embodiments.

FIG. 17 illustrates configuration registers comprising a scan chain thatdefine a configuration and connectivity of each spiking neuron circuitand each layer of spiking neuron circuits, according to someembodiments.

In the drawings, like reference numbers generally indicate identical orsimilar elements. Additionally, generally, the left-most digit(s) of areference number identifies the drawing in which the reference numberfirst appears.

DETAILED DESCRIPTION

Provided herein are system, apparatus, device, method and/or computerprogram product embodiments, and/or combinations and sub-combinationsthereof for an improved spiking neural network (SNN) configured to learnand perform unsupervised extraction of features from an input stream.Embodiments herein include a stand-alone neuromorphic integrated circuitproviding an improved SNN. The neuromorphic integrated circuit providesseveral benefits. First, the neuromorphic integrated circuit is compactin size. For example, the neuromorphic integrated circuit integrates ona silicon die a processor complex, one or more sensor interfaces, one ormore data interfaces, spike converters, and a memory. This enablesefficient use of the silicon area in hardware implementations. Second,the neuromorphic integrated circuit can be reprogrammed for manydifferent tasks using a user defined configuration file. For example,the connections between layers and neural processors in the neuromorphicintegrated circuit can be reprogrammed using a user definedconfiguration file. Third, the neuromorphic integrated circuit provideslow latency output. Fourth, the neuromorphic integrated circuit consumesa low amount of power consumption. For example, the neuromorphicintegrated circuit can consume two orders of magnitude less power than acomparable artificial neural network (ANN) when performing the sametask. Moreover, the neuromorphic integrated circuit can provide anaccuracy that approaches or equals the state of the art. Finally, theneuromorphic integrated circuit provides an improved learning methodthat exhibits both built-in homeostasis and rapid convergence ofsynaptic weights to incoming data patterns.

ANNs generally consist of artificial neurons featuring an architecturethat is determined at design time. The neurons can loosely model theneurons in a biological brain. The neurons can be hardware circuits ordefined programmatically. The function of an ANN can be defined byconnections between the neurons in a layer, connections between layersof neurons, synaptic weights, and the pre-processing of input data tofit a predefined input range.

In an ANN, inference can be performed using a multiply-accumulate (MAC)operation. In a MAC operation, incoming data values can be multiplied bya plurality of synaptic weights stored in a memory. For example, an ANNcan perform many MAC operations (e.g., 156 million MAC operations) perimage to classify an object in the image. The results of thesemultiplications can then be integrated by addition in each neuron in thenetwork. After performing the MAC operation, a non-linear function canbe applied to the integrated value of a neuron resulting in an outputvalue. The output value can be a floating-point value.

Multiple layers can be used to create an ANN to perform a specific task.Many neurons can be used in parallel in each layer of the ANN. A poolingoperation can also be performed between inference layers.

A Deep ANN can refer to a software or hardware implementation of an ANNwith many layers. Deep ANNs can be very successful at imageclassification. For example, Deep ANNs have been very successful atimage classification of images in ImageNet. ImageNet is a largecollection of hand-labeled images.

Deep ANNs are founded on the belief that biological neurons communicatedata through firing rates, e.g., the rate at which electrical impulsesare received and generated by a neuron. The neurons in a Deep ANN cancommunicate in floating point or multi-bit integer numbers.

Convolutional neural networks (CNNs) are a class of Deep ANNs in whichneurons are trained using many labeled examples to extract features thatoccur in dataset. For example, the dataset can be an image. CNNs canapply a convolution operation to the image. A convolution operation canact on a small section of the image and communicate a value indicatingthe occurrence of a feature in the image to the next layer in the CNN.The feature can be contained in a small rectangular area. This smallrectangular can be programmatically moved around a larger input image.When a feature in the image matches the feature information stored inthe synapse weights of a neuron, a value is sent to the next layer inthe CNN. In CNNs, the synapse weights are shared between neurons thatrespond to similar features in different locations of the image. Aneuron in a CNN can act as a filter for defined features. Training a CNNcan be accomplished through a mathematical optimizing technique known asbackpropagation.

While CNNs have been successful in detecting features and classifyingimages, they often suffer from several technological problems includinghigh computational demands, catastrophic forgetfulness, and incorrectclassification of adversarial samples. CNNs also suffer from highlatency. While many-core processors and massive parallel processing canbe used in CNNs to offset latency issues caused by high computationalrequirements, this often results in high power requirements for the CNN.For example, a CNN used to classify images in ImageNet can use as muchas 2000 watts of power. This is because the CNN may have to employ ahigh-powered central processing unit (CPU) and one or more graphicsprocessing units (GPUs) implemented on Peripheral Component InterconnectExpress (PCIe) add-in boards.

SNNs can solve some of the technological problems associated with theCNNs. SNNs are based on the proposition in bio-medical research thatbiological neurons communicate data in the timing of pulses that areemitted by the sensory organs and between neural layers. The pulses areshort bursts of energy referred to as spikes. SNNs are a class of ANNsin which information between neurons is expressed using spikes. Thespikes can express information based on their timing and spatialdistribution. Spiking neurons in a SNN may only spike, and consumeelectrical energy, when a series of events at the input is recognized asa previously learned sequence. This is similar to the processing thatoccurs in a biological brain. The technology to simulate brain functionin a SNN and to achieve a result such as classification of objects in animage, or recognition of specific features in a stream of data, can bereferred to as neuromorphic computing.

SNN can consume several orders of magnitude less power than other typesof ANNs because a neuron in a SNN does not constantly process to performthe MAC requirements of ANNs. Rather, the neuron can consume power onlywhen a spike occurs. In a SNN, a neural function can be emulated byadding a variable non-zero synaptic weight value to a simulated membranepotential value of the neuron every time an input spike is received. Thesimulated membrane potential value can then be compared to one or morethresholds. A spike can be generated when the membrane potential valueof the neuron reaches or exceeds a threshold. SNN do not exhibitcatastrophic forgetfulness and can continue learning after the SNN hasbeen trained. Moreover, there is no evidence that SNNs suffer fromincorrect classification due to adversarial samples.

But conventional SNNs can suffer from several technological problems.First, conventional SNNs are unable to switch between convolution andfully connected operation. For example, a conventional SNN may beconfigured at design time to use a fully-connected feedforwardarchitecture to learn features and classify data. Embodiments herein(e.g., the neuromorphic integrated circuit) solve this technologicalproblem by combining the features of a CNN and a SNN into a spikingconvolutional neural network (SCNN) that can be configured to switchbetween a convolution operation or a fully-connected neural networkfunction. The SCNN may also reduce the number of synapse weights foreach neuron. This can also allow the SCNN to be deeper (e.g., have morelayers) than a conventional SNN with fewer synapse weights for eachneuron. Embodiments herein further improve the convolution operation byusing a winner-take-all (WTA) approach for each neuron acting as afilter at particular position of the input space. This can improve theselectivity and invariance of the network. In other words, this canimprove the accuracy of an inference operation.

Second, conventional SNNs are not reconfigurable. Embodiments hereinsolve this technological problem by allowing the connections betweenneurons and synapses of a SNN to be reprogrammed based on a user definedconfiguration. For example, the connections between layers and neuralprocessors can be reprogrammed using a user defined configuration file.

Third, conventional SNNs do not provide buffering between differentlayers of the SNN. But buffering can allow for a time delay for passingoutput spikes to a next layer. Embodiments herein solve thistechnological problem by adding input spike buffers and output spikebuffers between layers of a SCNN.

Fourth, conventional SNNs do not support synapse weight sharing.Embodiments herein solve this technological problem by allowing kernelsof a SCNN to share synapse weights when performing convolution. This canreduce memory requirements of the SCNN.

Fifth, conventional SNNs often use 1-bit synapse weights. But the use of1-bit synapse weights does not provide a way to inhibit connections.Embodiments herein solve this technological problem by using ternarysynapse weights. For example, embodiments herein can use two-bit synapseweights. These ternary synapse weights can have positive, zero, ornegative values. The use of negative weights can provide a way toinhibit connections which can improve selectivity. In other words, thiscan improve the accuracy of an inference operation.

Sixth, conventional SNNs do not perform pooling. This results inincreased memory requirements for conventional SNNs. Embodiments hereinsolve this technological problem by performing pooling on previous layeroutputs. For example, embodiments herein can perform pooling on apotential array outputted by a previous layer. This pooling operationreduces the dimensionality of the potential array while retaining themost important information.

Seventh, conventional SNN often store spikes in a bit array. Embodimentsherein provide an improved way to represent and process spikes. Forexample, embodiments herein can use a connection list instead of bitarray. This connection list is optimized such that each input layerneuron has a set of offset indexes that it must update. This enablesembodiments herein to only have to consider a single connection list toupdate all the membrane potential values of connected neurons in thecurrent layer.

Eighth, conventional SNNs often process spike by spike. In contrast,embodiments herein can process packets of spikes. This can cause thepotential array to be updated as soon as a spike is processed. This canallow for greater hardware parallelization.

Finally, conventional SNNs do not provide a way to import learning(e.g., synapse weights) from an external source. For example, SNNs donot provide a way to import learning performed offline usingbackpropagation. Embodiments herein solve this technological problem byallowing a user to import learning performed offline into theneuromorphic integrated circuit.

In some embodiments, a SCNN can include one or more neural processors.Each neural processor can be interconnected through a reprogrammablefabric. Each neural processor can be reconfigurable. Each neuronprocessor can be configured to perform either convolution orclassification in fully connected layers

Each neural processor can include a plurality of neurons and a pluralityof synapses. The neurons can be simplified Integrate and Fire (I&F)neurons. The neurons and synapses can be interconnected through thereprogrammable fabric. Each neuron of the neural processor can beimplemented in hardware or software. A neuron implemented in hardwarecan be referred to as a neuron circuit.

In some embodiments, each neuron can use an increment or decrementfunction to set the membrane potential value of the neuron. This can bemore efficient than using an addition function of a conventional I&Fneuron.

In some embodiments, a SCNN can use different learning functions. Forexample, a SCNN can use a STDP learning function. In some otherembodiments, the SCNN can implement an improved version of the STDPlearning function using synapse weight swapping. This improved STDPlearning function can offer built-in homeostasis (e.g., stable learnedweights) and improved efficiency.

In some embodiments, an input to a SCNN is derived from an audio stream.An Analog to Digital (A/D) converter can convert the audio stream todigital data. The A/D converter can output the digital data in the formof Pulse Code Modulation (PCM) data. A data to spike converter canconvert the digital data to a series of spatially and temporallydistributed spikes representing the spectrum of the audio stream.

In some embodiments, an input to a SCNN is derived from a video stream.The A/D converter can convert the video stream to digital data. Forexample, the A/D converter can convert the video stream to pixelinformation in which the intensity of each pixel is expressed as adigital value. A digital camera can provide such pixel information. Forexample, the digital camera can provide pixel information in the form ofthree 8-bit values for red, green and blue pixels. The pixel informationcan be captured and stored in memory. The data to spike converter canconvert the pixel information to spatially and temporally distributedspikes by means of sensory neurons that simulate the actions of thehuman visual tract.

In some embodiments, an input to a SCNN is derived from data in theshape of binary values. The data to spike converter can convert the datain the shape of binary values to spikes by means of Gaussian receptivefields. As would be appreciated by a person of ordinary skill in theart, the data to spike convert can convert the data in the shape ofbinary values to spikes by other means.

In some embodiments, a digital vision sensor (e.g., a Dynamic VisionSensor (DVS) from supplied by iniVation AG or other manufacture) isconnected to a spike input interface of a SCNN. The digital visionsensor can transmit pixel event information in the form of spikes. Thedigital vision sensor can encode the spikes over an Address-eventrepresentation (AER) bus. Pixel events can occur when a pixel isincreased or decreased in intensity.

In some embodiments, an input format of a SCNN is in the shape ofspatial and temporal distributed spikes. A spike can be defined as ashort burst of electrical energy.

In some embodiments, a SCNN can consist of one or more layers of spikingneurons. Spiking neurons can simulate the function of neurons. Thespiking neurons can be interconnected through circuits that simulate thefunction of synapses.

A spiking neuron can be implemented in hardware or software. A hardwareimplemented spiking neuron can be referred to as a spiking neuroncircuit. However, as would be appreciated by a person of ordinary skillin the art, a software implemented spiking neuron can be used in placeof a spiking neuron circuit in any embodiment herein.

In some embodiments, a SCNN can be configured from a storedconfiguration. The stored configuration can be modified using a YAMLAin′t Markup Language (YAML) file. The YAML file can define the functionof components in a neural fabric to form a SCNN directed to a specifictask. For example, a YAML file can configure the SCNN to classify imagesin the Canadian Institute For Advanced Research 10 (CIFAR-10) dataset (acollection of images that are commonly used to train machine learningand computer vision algorithms).

In some embodiments, each layer in a SCNN can be defined, connected, andconfigured as a convolutional layer with max pooling and shared synapseweights, or as a fully connected layer with individual synapses.

In some embodiments, convolutional layers can be used in combinationwith one or more max pooling layers in dimensionality reduction of aninput signal by extracting certain features and communicating thosefeatures as metadata to the next layer in a SCNN. The metadata passed byeach neuron can be in the form of the neuron membrane potential value ora spike. A spike can indicate that a threshold value has been reached.The spike can either trigger a learning event or an output spike. Aneuron membrane potential value is a potential value of a neuron. Theneuron membrane potential value can be read independently of thresholds.

In some embodiments, convolutional network layers in a SCNN can includea plurality of spiking neuron circuits. Each spiking neuron circuit caninclude an integrator and a plurality of synapses that are shared withother neurons in the layer. Each spiking neuron circuit can beconfigured as a feature detector. A convolutional layer can beimmediately followed by a pooling layer. A pooling layer can bemax-pooling layer, an average pooling layer, or another type of poolinglayer as would be appreciated by a person of ordinary skill in the art.A max-pooling layer can receive the output of the spiking neuroncircuits (e.g., feature detectors). The max-pooling layer can pass on tothe next layer only the neuron output (e.g., neuron membrane potentialvalue or a spike) with the highest potential value. An average poolingcan perform a down-sampling by dividing the input into rectangularpooling regions and computing the average values of each region.

In some embodiments, fully connected layers in a SCNN can be used inclassification, autonomous feature learning, and feature extraction. Afully connected layer can include a plurality of spiking neuroncircuits. Each spiking neuron circuit can include an integrator and aplurality of synapses. The plurality of synapses may not be shared withother neuron circuits in the fully connected layer.

In some embodiments, learning in a SCNN can take place through a methodknown as Spike Timing Dependent Plasticity (STDP). In STDP learning, aninput spike that precedes an output spike indicates the input spikecontributed to the output spike. In STDP, this can causes the synapseweight to be strengthened.

In some embodiments, the STDP learning method is improved using synapseweight swapping. Synaptic weight values can be swapped across synapsesto reinforce the synaptic inputs that contributed to output spike eventsand to weaken the synapses that did not contribute. This can cause thespiking neuron circuit to become increasingly more selective to aspecific input feature.

In some embodiments, the STDP learning method is further improved usingtertiary synapse weights. Tertiary synapse weights can have positive,zero, or negative values. Synapses that store positive weights can bereferred to as excitatory synapses. Synapses that store negative weightscan be referred to as inhibitory synapses. Synapses that store zeroweights may not contribute to the selection process.

In some embodiments, an spike input buffer exists at the input of eachlayer of the neural network. An spike input buffer can receive andstores spike information. The spike information can be transmitted tothe spike input buffer as digital bits. The presence of a spike can berepresented using a ‘1’. The absence of a spike can be represented usinga ‘0’.

In some embodiments, a packetizer can sort the spikes in the spike inputbuffer into one or more spike packets. A spike packet can be stored in apacket register.

In some embodiments, a first logical AND function can be applied to thebit pattern stored in the packet register and the positive weight bitsstored in the synapses. A logical ‘1’ at the output of the first logicalAND function increments the membrane potential counter of the spikingneuron circuit. A second AND function can be applied to the bit patternstored in the input spike buffer and the inverted negative weight bitsin the synapses. A logical ‘1’ at the output of the second logical ANDfunction decrements the membrane potential counter of the spiking neuroncircuit.

In some embodiments, a layer in a SCNN is collection of neurons thatshare parameters. The layer can receive spike information from previouslayers and propagate the spike information to subsequent layers.

In some embodiments, a SCNN can support a feed-forward and feed-backarchitecture. This can be a connection topology where each layerreceives inputs from a local bus structure and passes outputs to thesame local bus.

In some embodiments, each layer can receive and transmit address-eventrepresentation (AER) style data structures that contain a header andevent addresses. This information can be received into a spike inputbuffer. An AER event contains three components: x, y, f, where f is thefeature (e.g., channel) and x, y are the coordinates of the spikingneuron circuit that spiked. The input spike buffer can be processed tocreate a spike packet that is processed by the layer. The layer canoutput a spike to an output spike buffer to the next layer forprocessing.

In some embodiments, all layer types that are not of an input layer typecan have a potential array. The potential array can store the membranepotential values of each spiking neuron circuit.

In some embodiments, each layer can include two data structures thatdescribe the connectivity between spiking neuron circuits in the layerand the inputs to the neurons. The first data structure can be referredto as a connection list array. Entries in the connection list array cancorrespond to a list of spiking neuron circuits to which a specificinput is connected. The connection list array can contain connectivityinformation from source to destination.

The second data structure can be referred to as a weight vector array.Each entry in the weight vector array corresponds to a vector of inputsto which a specific spiking neuron circuit is connected. The weightvector array can contain destination to source information.

In some embodiments, each spiking neuron circuit in a fully connectedlayer type has a single entry in the potential array. In contrast, insome embodiments, the spiking neuron circuits of a convolution layer canshare a single set of synaptic weights that is applied to x-ycoordinates across every input channel. The synaptic weight can bestored in destination to source format in the weight vector array.

In ANNs with computationally derived neuron functions (e.g., DeepLearning Neural Networks (DNN), training and inference can be twoseparate operations that take place in different environments ormachines. During a training phase, a DNN learns from a large trainingdata set by computing the synaptic weight values in the neural networkby means of back-propagation. In contrast, learning may not take placeduring an inference phase of the DNN.

In some embodiments, a SCNN makes no clear division between training andinference operations. The inference operation can operate through eventpropagation. Event propagation can refer to the processing of inputs bya layer of the SCNN to update the potential array and generate an outputspike buffer of spikes that fire for the layer. The spiking neuroncircuits in a layer can first perform the event propagation step (e.g.,inference) and then the learning step. In some embodiments, whenlearning is disabled in a layer of the SCNN, the layer may only performthe event propagation step which is effectively the inference phase.

In some embodiments involving convolution, spiking neuron circuits canshare synaptic weights. These neuron circuits can be referred to asfilters. This is because these spiking neuron circuits can filter aspecific feature from an input stream.

FIG. 1 is a block diagram of a neural network model, according to someembodiments. In FIG. 1 , spikes can be communicated over a local bus101. For example, local bus 101 can be a network on a chip (NoC) bus.The spikes can be communicated in the form of network packets. A networkpacket can contain one or more spikes and a code indicating origin anddestination addresses.

In FIG. 1 , spike decoder 102 can decode spikes in the network packets.Spike decoder circuit 102 can send a spike to a specific spiking neuroncircuit based on an origin address in the network packet. For example,spike decoder circuit 102 can store the spike in the spike input buffer103 of the corresponding spiking neuron circuit. Spike decoder circuit102 can also store in the spike input buffer 103 of the correspondingneuron circuit the address where the bit is going to finish up at.

Spike input buffer 103 can store one or more spikes. A ‘1’ bit canrepresent the presence of a spike and a zero bit can represent theabsence of a spike. Spike input buffer 103 can also contain an addresswhere a bit is going to finish up at.

In FIG. 1 , packetizer 114 can sort the spikes in spike input buffer 103into one or more spike packets. A spike packet can be stored in packetregister 104. For example, in the case where a spiking neuron circuithas 1024 synapses, packet register 104 can be 1024 bits long. Packetizer114 can sort the bits in spike input buffer 103 into the correctpositions along the 1024 bit packet register 104. This sorting processis further described in FIG. 6 .

In FIG. 1 , synaptic weight values can be stored in synaptic weightstorage 105. In some embodiments, synaptic weight storage 105 can beimplemented using static random-access memory (SRAM). As would beappreciated by a person of ordinary skill in the art, synaptic weightstorage 105 can be implemented using various other memory technologies.

Synaptic weight values in synaptic weight storage 105 can be positive ornegative. In some embodiments, synaptic weight values in synaptic weightstorage 105 can be transferred into weights register 106 for processing.The positive synaptic weight values in weights register 106 can be ANDedin logical AND circuit 107 with corresponding bits in packet register104. The resulting output of logical AND circuit 107 can incrementcounter 109 for each positive result of the AND function. Counter 109can represent the membrane potential value of a neuron.

The negative synaptic weight values in the weights register 106 can beANDed in logical AND circuit 108 with corresponding bits in packetregister 104. The resulting output of logical AND circuit 108 candecrement the counter 109. This process can be continued until all bitsin packet register 104 have been processed.

After all bits in packet register 104 have been processed, counter 109can contain a value that is representative of the number of bits inpacket register 104 that correspond to positive and negative synapticweight values in weights register 106. The value in counter 109 can becompared to at least one threshold using threshold comparator 110.

In some embodiments, threshold comparator 110 can compare the value incounter 109 to two thresholds. For example, threshold comparator circuit110 can compare the value in counter 109 to a value in learningthreshold register 111 and a value in spiking threshold register 112.

In some embodiments, the value in learning threshold register 111 caninitially be set to a low value to allow the neuron to learn. During thelearning process, synaptic weights can be assigned to incoming spikesusing weight swapper 113. This process is illustrated in FIG. 8 and FIG.9 . In some embodiments, as the neuron learns, the value in the counter109 increases, and the value in learning threshold register 111increases as well. This process can continue until the neuron presents astrong response to a specific learned pattern.

FIG. 2A is a block diagram of a neuromorphic integrated circuit 200,according to some embodiments. Neuromorphic integrated circuit 200 caninclude a neuron fabric 201, a conversion complex 202, sensor interfaces203, a processor complex 204, one or more data interfaces 205, one ormore memory interfaces 206, a multi-chip expansion interface 207 thatcan provide a high speed chip-to-chip interface, a power management unit213, and one or more Direct Memory Access (DMA) engines 214.

In some embodiments, neuron fabric 201 can include a plurality ofreconfigurable neural processors 208. A neural processor 208 can includea plurality of neurons. For example, a neural processor 208 can includea plurality of spiking neuron circuits and a plurality of synapses. Asdiscussed above, a spiking neuron circuit can be implemented using aninput spike buffer 103, packetizer 114, packet register 104, logical ANDcircuit 107, logical AND circuit 108, counter 109, threshold comparator110, learning threshold value 111, spiking threshold value 112. Theplurality of synapses can implement using weights register 106, synapticweight storage 105, and weight swapper 113. Each neural processor 208can include a plurality of reprogrammable spiking neuron circuits thatcan be connected to any part of neural fabric 201.

In some embodiments, conversion complex 202 can include one or more of apixel to spike converter 209, an audio to spike converter 210, a DynamicVision Sensor (DVS) to spike converter 211, and a data to spikeconverter 212. Pixel to spike converter 209 can convert images to spikeevents.

In some embodiments, sensor interfaces 203 can include one or moreinterfaces for pixel data, audio data, analog data, and digital data.Sensor interfaces 203 can also include an AER interface for DVS pixeldata.

In some embodiments, processor complex 204 can include at least oneprogrammable processor core, a memory, and input-output peripherals.Processor complex 204 can be implemented on the same die as neuromorphicintegrated circuit 200.

In some embodiments, data interfaces 205 can include one or moreinterfaces for input and output peripherals. The one or more interfacescan use a Peripheral Component Interconnect Express (PCIe) bus standard,a Universal Serial Bus (USB) bus standard, the Ethernet bus standard, aController Area Network (CAN) bus standard, and a Universal AsynchronousReceiver and Transmitter (UART) for transmitting and receiving serialdata.

In some embodiments, memory interfaces 206 can include one or moreinterfaces for dynamic random access memory (RAM) expansion. The one ormore interfaces can use a double data rate synchronous dynamicrandom-access memory (DDR SDRAM) standard. For example, the one or moreinterfaces can use a DDR3 or DDR4 standard.

In some embodiments, multi-chip expansion interface 207 can carry spikeinformation to enable an expansion of neural fabric 201 to multiplechips. Multi-chip expansion interface 207 can carry spike informationusing AER. AER is a standard for transmitting spike events over a systembus. The address of a specific neuron that spikes at the time that thespike occurs is transmitted.

In some embodiments, neuromorphic integrated circuit 200 can take spikeinformation as input and produce AER spike events as outputs. Inaddition to outputting the spikes from the last layer of the SCNN, AERspike events can also transmit the membrane potential values for eachspiking neuron circuit.

In some embodiments, neural fabric 201 can process spikes in afeed-forward manner. Spikes can be sent between layers using AER formatdata. Each layer can have an input spike buffer (e.g., input spikebuffer 103) that converts spikes stored in the input spike buffer to aset of spike packets. Every layer can process all spikes in an inputspike buffer completely before sending its output spikes to the nextlayer.

FIG. 2B is another block diagram of the neuromorphic integrated circuit200 in FIG. 2A, according to some embodiments. FIG. 2B illustrates theinterconnection of the components of the neuromorphic integrated circuit200 using a local bus 220 (e.g., a NoC bus). In FIG. 2B, neuromorphicintegrated circuit 200 can include neuron fabric 201, processor complex204, one or more data interfaces 205, pixel to spike converter 209,audio to spike converter 210, and DMA engines 214, as illustrated inFIG. 2A. Neuromorphic integrated circuit 200 can also include synapticweight storage 222, memory 224, serial read-only memory (ROM) 226,configuration register 228, PCIe interface block 230, PCIe bus 232, UARTinterface 234, CAN interface 236, USB interface 238, and Ethernetinterface 240.

In some embodiments, synaptic weight storage 222 can be equivalent tosynaptic weight storage 105 in FIG. 1 . Synaptic weight storage 222 canconnect to neuron fabric 201. Synaptic weight storage 222 can store theweights of all synapses and the membrane potential values of all spikingneuron circuits. Synaptic weight storage 222 can be accessed externallythrough one or more DMA engines 214 from PCIe interface block 230 whichcan connect to PCIe bus 232.

In some embodiments, configuration registers 228 can connect to neuronfabric 201. During the initialization of neuron fabric 201, processorcomplex 204 can read serial ROM 226 and configure neuron fabric 201 foran externally defined function by writing values to configurationregisters 228 and synaptic weight storage 222.

In some embodiments, processor complex 204 is available externallythrough PCIe interface 230. A program can be stored in memory 224. Theprogram can determine the function of UART interface 234, CAN interface236, USB interface 238, and Ethernet interface 240. One or more of theseinterfaces can deliver data to be processed by neuron fabric 201,processor complex 204, or both.

Audio to spike converter 210 can deliver spikes directly onto local bus220 to be processed by neuron fabric 201. Pixel to spike converter 209can connect to an external image sensor and converts pixel informationto spike packets, which are distributed on the local bus 220 forprocessing by neuron fabric 201. Processed spikes can be packetized(e.g., inserted into network packets) and placed on the local bus 220.

FIG. 3 is a flow diagram of input spike buffering, packetizing, andoutput spike buffering for a next layer, according to some embodiments.FIG. 3 includes an input spike buffer 301, one or more spike packets302, a neuron fabric 303, and an output spike buffer 304. In FIG. 3 ,spikes in input spike buffer 301 can be sorted into one or more spikepackets 302 for specific neurons (e.g., spiking neuron circuits) inneuron fabric 303. After processing in neuron fabric 303, any resultingspikes can be stored in output spike buffer 304 which is sent to thesubsequent layer. The resulting spikes in output spike buffer 304 can bepacketized for processing by the subsequent layer.

In some embodiments, a layer in neuron fabric 303 can process the entireinput spike buffer 301. The layer can process each spike packet 302sequentially. The resulting output spikes can be placed in output spikebuffer 304. Output spike buffer 304 may not be sent to the next layerfor processing until all spike packets 302 have been processed. In someembodiments, all layers of neuron fabric 303 can follow this workflow.

In some embodiments, neuron fabric 303 can process many spikes at atime. In some embodiments, different spike buffer types can be used forlayers in neuron fabric 303. The type of spike input buffer can dependon the nature of the input data. The difference between spike buffertypes can lie in how they generate spike packets from the input spikebuffer 301.

In some embodiments, a packetizing buffer type can be used to processcontinuous or ongoing types of data (e.g., a stream of spikes generatedby a DVS camera). A user can configure different layers of neuron fabric303 to use this buffer type. A packetizing buffer type can enable theprocessing of many spikes, either one at a time or in very large bursts.A packetizing buffer can stores spikes in the order they are receiveduntil the number of spikes reaches a size defined by a parameter (e.g.,a packet size) specified in a configuration file (e.g., a YAML file).Once the packetizing buffer reaches the size, a spike packet can bepassed to the neural fabric 303 for processing. The packetizing buffercan then be cleared. The packetizing buffer can then continue to storespikes.

In some embodiments, a flushing buffer type can be used to process datain the form of a defined size (e.g., traditional video image frames ordefined sets of values). For example, a video frame can have a definedsize such as 640 by 480 pixels. In this case, however, many spikes sentat once may be immediately sent for processing as a single packet. Thespike packets can be different lengths.

In some embodiments, each layer type can implement a function whichprocesses the entire spike input buffer (e.g., spike input buffer 301)by first generating packets from the spike input buffer. After theentire spike input buffer has been packetized, this function can processall spike packets. This function can then delete the processed spikepacket and push the output spikes from the spike packet to the outputspike buffer (e.g., output spike buffer 304). This function can then getthe next spike packet to process. The difference between buffer typescan lie in how they generate spike packets from the input spike buffer.

FIG. 4 is a block diagram of a neural processor 400 configured as aspiking convolutional neural processor, according to some embodiments.The neural processor 400 can include a network on a local bus 401 (e.g.,a NoC bus), a spike decoder 402, a synaptic weight storage 403, a neuronposition generator, a pooling circuit 404, a neuron fabric 405, apotential update and check circuit 406, and a spike generator 407.Neuron fabric 405 can be equivalent to neuron fabric 201 in FIG. 2 .Synaptic weight storage 403 can store synaptic weight values andmembrane potential values for neurons (e.g., potential array). Poolingcircuit 404 can perform a max pooling operation, average poolingoperation, or other type of pooling operation as would be appreciated bya person of ordinary skill in the art. One to many spike generatorcircuit 407 can generate spike packets which can be transmitted one tomany across local bus 401.

FIG. 5 is a block diagram of a neural processor 500 configured as aspiking fully connected neural processor, according to some embodiments.The neural processor 500 includes a local bus 501 (e.g., a NoC bus), aspike decoder 502, a synaptic weight storage 503, a neuron positiongenerator, a packet former 504, a neuron fabric 505, a potential updateand check circuit 506, and a potential and spike output circuit 507.Neuron fabric 505 can be equivalent to neuron fabric 201 in FIG. 2 .Synaptic weight storage 503 can store synaptic weight values andmembrane potential values for neurons (e.g., potential array). In FIG. 5, spikes can be received into a spike input buffer and distributed asspike packets using spiking decoder 502.

In some embodiments, synapse weights can be tertiary weights. Thesetertiary synapse weights can be 2-bits wide. These 2-bit wide synapseweights can include both positive and negative values. This is differentthan conventional SNNs. Positive values in the 2-bit wide synapseweights can increase a membrane potential value of a neuron. Negativevalues in the 2-bit wide synapse weights can decrease a membranepotential value of a neuron.

In some embodiments, spikes in a spike packet can be distributedaccording to their synapse destination numbers. In some embodiments,during processing, the tertiary synaptic weights are logical ANDed withthe spikes represented in the spike packet. The spikes in a spikepackets can be represented using positive spike bits. The absence of aspike in a spike packet can be represented using a zero. Synapticweights can be negative or positive. A negative synaptic weight candecrement counter 109 (e.g., membrane potential register) of the neuron.A positive synaptic weight can increment counter 109 (e.g., membranepotential register) of the neuron.

In some embodiments, a learning process can be implemented by examiningan input when a learning threshold value of the neuron is reached (e.g.,a value in learning threshold register 111). The learning thresholdvalue of the neuron can be initially set to a very low value. Thelearning threshold value can increase as the neuron learns and moresynaptic weights are matched. In some embodiments, the learning processmay involve the swapping of unused synaptic weights (e.g., a positivesynaptic weight in a location where no spike has occurred) and unusedspikes (e.g., a spike in the spike packet that is in a position relativeto a synaptic weight having a value of zero). The unused synapticweights can be swapped to locations containing unused spikes.

In some embodiments, if the neuron membrane potential value (e.g.,represented by counter 109) exceeds a spiking threshold value (e.g., avalue in spiking threshold register 112) then a spike is generated. Thespike is placed on the local bus.

FIG. 6A is an example of packetizing spikes into a spike packet,according to some embodiments. In FIG. 6A, spike input buffer 601 (e.g.,equivalent to spike input buffer 103) receives spikes from a local busthat have been processed by a spike decoding circuit. Packetizer 602 cansort the spikes in the spike input buffer 601 into a spike packet 603according to the spikes' synapse index numbers. For example, in FIG. 6A,the spike sequence that is received is 1, 6, 23, 1, 19, 18. As would beappreciated by a person of ordinary skill in the art, the spike sequencemay be much larger than the small number of spikes shown in FIG. 6A. Forexample, the spike sequence can include thousands of spikes that aredistributed to a multitude of synapses.

FIG. 6B is an example representation of spike packet 603 in FIG. 6A,according to some embodiments. In FIG. 6B, spike packet 603 contains thesorted spikes from spike input buffer 601. In spike packet 603,positions 1, 6, 18, 19, and 23 are highlighted indicating they containlogic ‘1’ values. The remaining positions within spike packet 603contain zeros (e.g., indicating the absence of a spike).

In some embodiments, spikes can be organized in the same order as thesynapse weights are located in memory (e.g., synaptic weight storage105). This can make it possible to perform AND operations between thesynaptic weight values and the spikes in the incoming spike packets todetermine if the membrane potential counter (e.g., counter 109) isincremented or decremented. When a spike occurs at a position where thesynaptic weight value is zero the counter is not changed for that bitposition.

FIG. 7 is an example of a method of selecting whether the membranepotential value (e.g., counter 109) is incremented or decremented,according to some embodiments. In FIG. 7 , a logical AND operation isperformed between spike packet 701 and weights register 702 (e.g.,weight register 702 is equivalent to weight register 106). In FIG. 7 ,spike bits 1, 6, 18, 19, and 23 of spike packet 701 are highlightedindicating they contain logic ‘1’ values (e.g., indicating the presenceof a spike). The remaining positions within spike packet 701 containzeros (e.g., indicating the absence of a spike).

Weight register 702 can contains logic bits that indicate eitherpositive or negative values. In FIG. 7 , bits 1, 4, 5, 14, and 22contain positive values while bit 18 contains a negative value. Positivevalues can indicate an excitatory action while negative values canindicate an inhibitory action. The bits in weight register 702 can belabeled EXC for excitatory and INH for inhibitory weights. A logical ANDis performed between the bits in weight register 702 and the bits inspike packet 701. The spike that occurred in position 1 thereforeincrement the membrane potential value (e.g., counter 109) of theneuron. In contrast, the spike that occurred in position 18 decrementsthe membrane potential value (e.g., counter 109) of the neuron.

FIG. 7 is an example of a Spike Time Dependent Plasticity (STDP)learning method, according to some embodiments. In STDP learning, spikesthat contribute to an output event/spike can have their representativesynaptic weights strengthened while spikes that did not contribute to anoutput event/spike can have their synaptic weights weakened.

In some embodiments, the STDP learning method is modified such thatunused synaptic weights are swapped to locations contained unusedspikes. For example, synaptic weights that are zero, and received aspike, are swapped with synaptic weights that are logic ‘1’ and did notreceive any spike.

In some embodiments, when a logical AND operation is performed on aspike bit in the spike packet that is ‘1’ and a synaptic weight that iszero, the result is a zero. This can be referred to as an ‘unusedspike.’ When a logical AND operation is performed on a spike bit in thespike packet that is ‘0’ and a synaptic weight that is ‘1’, the resultis zero. This can be referred to as an ‘unused synaptic weight’. Thelearning circuit (e.g., weight swapper 113) can swap random selectedunused synaptic weights where unused spikes occur.

In FIG. 7 , position 1 in spike packet 701 contains a used spike.Position 1 in synaptic weights 702 contains a used weight. This canresult in an increment of the membrane potential value (e.g., counter109) of the neuron.

Positions 4 and 5 of synaptic weights 702 contain unused synapticweights. These synaptic weights are candidates for swapping. Position 6of spike packet 701 contains an unused spike. In other words, position 6of spike packet 701 contains 1 but position 6 of synaptic weights 702contains a zero. An unused synaptic weight can be swapped to thisposition. Position 14 of synaptic weights 702 contains an unusedsynaptic weight. Position 18 of spike packet 701 contains a used spikeand position 18 of synaptic weights 702 contains a used synaptic weight(in this case inhibitory). This can result in a decrement of themembrane potential value (e.g., counter 109) of the neuron. Position 19of spike packet 701 contains an unused spike. Position 22 of synapticweights 702 contains an unused synaptic weight. Position 23 of spikepacket 701 contains an unused spike.

This STDP learning method is inspired by the learning that takes placein the biological brain. In some embodiments, a modified form of theSTDP learning method is used to perform learning. This modified methodis similar to the mechanism by which biological neurons learn.

In some embodiments, a spiking neuron circuit emits a spike when itsinputs drive its membrane potential value (e.g., counter 109) up to athreshold value. This can mean that when the neuron is driven to thethreshold value and generates a spike, connections from its recentlyactivated inputs are strengthened, while a number of its otherconnections are weakened. The can result in neurons learning to respondto patterns of inputs that they see repeatedly, thereby autonomouslylearning the features that characterize an input dataset.

In some embodiments, depending on other properties of this STDP method,such as natural competition between neurons caused by the variation oflearning threshold values, the population of neurons within a layerlearn a broad coverage of the input feature space. Thus, the response ofthe population of neurons to a given input carries information about thefeatures that are present.

In the brain, sensory processing is typically hierarchical, taking placeover a series of layers. Early layers extract information about simplefeatures, with higher layers learning to respond to combinations ofthose features, such that their responses are both more selective tomore complex shapes or objects, and more general in that they areinvariant to spatial position or orientation.

In some embodiments, this modified STDP learning method is completelyunsupervised. This is different than conventional diverse supervisedtraining methods that are in use in neural networks. This means thatembodiment herein can be presented with an unlabeled dataset, andwithout any additional information can learn to respond to differentfeatures that are present in the data. Learning can be an ongoingprocess.

In some embodiments, there is no need to retrain the entire neuralnetwork (e.g., neuron fabric 201) when a new class is added to analready-trained data-set. This can eliminate the technological problemof catastrophic forgetfulness. By allowing learning to continue, newclasses can be added to the features that are already recognized by thenetwork.

Unsupervised learning can extract features. However, in the absence oflabeled data, unsupervised learning cannot directly ‘label’ its outputs.In a classification task, the neural network (e.g., neuron fabric 201)can learn a set of features that differentiate classes present in thestimulus data set. It can then be up to the user to apply a methodlinking responses representing features to input labels.

FIG. 8 illustrates a weight swapping step of the STDP learning method,according to some embodiments. FIG. 8 shows an example of the next stepin the modified STDP learning process whereby ‘unused synaptic weights’are swapped to ‘unused inputs’ thereby strengthening the neurons'response to the same or a similar input spike pattern in the future.

In FIG. 8 , spike bits 1, 6, 18, 19, and 23 of spike packet 801 arehighlighted indicating they contain logic ‘1’ values (e.g., indicatingthe presence of a spike). The remaining positions within spike packet801 contain zeros (e.g., indicating the absence of a spike). Bits 1, 4,5, 14, and 22 of synaptic weights 802 contain ‘+1’ values while bit 18contains a ‘−1’ value. Bit 19 of unused spikes 801 represents an unusedspike in spike packet 801. Bits 5 and 14 of unused synaptic weights 802represents unused synaptic weights in synaptic weights 802. In FIG. 8 ,new synaptic weights 805 represents the result of swapping unusedsynaptic weights (e.g., a positive synaptic weight in a location whereno spike has occurred) and unused spikes (e.g., a spike in the spikepacket that is in a position relative to a synaptic weight having avalue of zero). For example, bit 14 of new synaptic weights 805 containsthe value of bit 18 of synaptic weights 802 and vice versa.

FIG. 9 illustrates convolution in a neural processor configured as aspiking fully connected neural processor, according to some embodiments.For example, FIG. 9 shows the modified STDP method of learning by weightswapping in convolution layers which are used in neural processorsconfigured as spiking fully connected neural processors.

A convolution can be a mathematical operation with the purpose ofextracting features from data (e.g., an image). The result of aconvolution between two sets of data, whether image data or another datatype, is a third set of data.

In some embodiments, a convolution can acts on spikes and potentialvalues. Each neural processor (e.g., neural processor 208) can identifythe neuron with the highest potential value and broadcast it to otherneural processors in the same layer. In some embodiments, if thepotential value of the neuron is higher than the learning thresholdvalue (e.g., a value in learning threshold register 111), the synapticweights of all kernels of the neurons outputting to the neuron areupdated. The same event packet can be re-transmitted from the previouslayer. A neural processor may only affect the spikes within a receptivefield of the neuron. For example, in FIG. 9 , like the area within thesquare of 902. The neural processor 208 identified the unused spikes(shown as U) in the receptive field and the unused weights (show as U)in the kernels (e.g., kernels 901 and 903).

In some embodiments, the modified STDP learning method can determine thetotal number of swapped bits across all kernels between unused andpreferred synaptic weights according to a rule. For example, the rulemay be that number of swapped bits=min(number of swaps, number of unusedspikes, number of unused weights), where number of swaps can be aconfiguration field. In this example, min(5, 3, 4)=3. The modified STDPlearning method can then randomly swap “number of swapped bits” bitsacross all kernels. In FIG. 9 , three bits are swapped. The modifiedSTDP learning method can then update the synaptic weights of the filterof all other neural processors of the same layer accordingly.

Neural networks can have a training phase. The training phase can useknown samples. Neural networks can also have an inference stage duringwhich samples that were not previously used are recognized. During thetraining phase, output neurons are labelled according to the stimulusclass that they respond most to. During the inference phase, the inputsare labelled according to the features that neurons responded most to.The unsupervised learning method of embodiments herein can be usefulwhere a substantial dataset exists of which only a small portion hasbeen labelled. In this case, embodiments herein can be trained on theentire dataset, after which a supervised stage is performed to label thenetwork outputs using the smaller labelled dataset.

In some embodiments, a supervised learning algorithm can be used. Theinference component of embodiments herein can be completely separablefrom the learning algorithm, retaining its benefits of fast, efficientcomputation. Embodiments herein have been designed such that synapticweights learned offline using an algorithm of the user's choice caneasily be uploaded. The network design can be restricted to binary orternary synaptic weights and activation levels. A growing number ofthird-party techniques exist destined for supervised learning withinthese constraints.

While unsupervised learning can perform well on these tasks, aided bysupervision at some stage, there will be some cases where a supervisedlearning method has an advantage. Equally however, unsupervised learninghas the capacity to perform tasks that are impossible for a supervisedlearning method—e.g., finding unknown and unexpected patterns in datawhere there is no labelled outcome to use for supervision. Theseapproaches are easy to miss.

FIG. 10 illustrates a symbolic representation of a convolution in an 8by 8 matrix of pixels of depth 1, according to some embodiments. In FIG.10 , an example 5 by 5 convolution filter 1002 is applied. In FIG. 10 ,filter 1002 is allowed to ‘stick out’ of the original input. In FIG. 10, this can be done by padding the original input 1001 with zeros.

Four convolution types are supported: valid, same, full and padding.FIG. 10 illustrates the resulting convolutions. A ‘full’ convolution(e.g., full convolution 1003) can increase the output convolution sizethe most with a padding of 4. A ‘same’ convolution (e.g., sameconvolution 1004) can use a padding of 2 to generate an outputconvolution size that is the same as the original input dimensions(e.g., 8×8×1). A ‘valid’ convolution (e.g., valid convolution 1005) canuse 0 padding and result in an output convolution size that is less thanthe original input dimensions.

In some embodiments, the SCNN can be allowed to use full convolution,same convolution, or valid convolution. The SCNN can also be allowed touse a custom convolution type referred to as ‘padding.’ A programmer canindicate a padding convolution type by specifying the padding aroundeach side of the original input 1001.

In some embodiments, the different types of convolution can be definedby Equations 2-4. Equations 2-4 can define a size of the convolved inputas a function of the original input size and the filter size. InEquations 2-4, l_(w) can represent the width of the original input,C_(w) can represent the width of the convolved input (e.g., potentialarray), and k_(w) can represent the width of the filter.

Valid type:C _(w) =l _(w)−(k _(w)−1)  (2)

Same type:C _(w) =l _(w)  (3)

Full type:C _(w) =l _(w)+(k _(w)−1)  (4)

FIG. 11 illustrates a symbolic representation of a convolution involving2 channels of spikes, two 3 by 3 inverse convolution kernels, andresulting membrane potential values, according to some embodiments. FIG.11 illustrates two channels of spikes 1101 and 1102. FIG. 11 furtherillustrates two 3×3 inverse convolution kernels 1103 and 1104, andresulting neuron membrane potential values 1105. A two-channel exampleof the present embodiment is presented here, with the modification thatthese operations are performed using spiking neuron circuits rather thana programmed processor. First, all the potentials in a neural processorconfigured as a SCNN processor are cleared to zeros. When an spikepacket comes in, the processing of the spike packet causes the membranepotential values of affected neuron circuits to change.

FIG. 12 illustrates the resulting spikes generated in spiking neuroncircuits on channels 1101 and 1102 of FIG. 11 , according to someembodiments. Channel 1101 illustrates the spiking neuron circuits thatfired as ‘1’s in the matrix. All the other locations in channel 1101 arefilled with zeros. The spike map can be convoluted using the two inversekernels 1103 and 1104 shown in FIG. 11 for channels 1101 and 1102,resulting in the neuron membrane potential values 1105 shown in FIG. 11.

FIG. 13 illustrates a spiking neural network convolution operation,according to some embodiments. FIG. 13 shows an input (e.g., an image)with three channels (e.g., channels 1301, 1302, and 1303) beingprocessed by two filters (e.g., filters 1304 and 1305). Blank entries infilters 1304 and 1305 can correspond to zero values.

In FIG. 13 , filter 1304 has a dimensionality of 5×5×3 (e.g.,filterWidth× filterHeight× channelNumber). Filter 1304 is centered oncoordinates (2, 2) of the input image. The upper-left corner of theinput image has coordinates (0, 0). The width and height of the filtercan be smaller than the input image. As would be appreciated by a personof ordinary skill in the art, a filter often has a 3×3, 5×5, or 7×7configuration.

In some embodiments, a filter can have different sets of weights thatcorrespond to a specific channel of the input. Each set of weights canbe referred to as kernel of the filter. In FIG. 13 , filter 1304 hasthree kernels (e.g., kernels 1306, 1307, and 1308). The number ofkernels in each filter can match the number of channels in the input.Every input event can have an (x, y) coordinate and a channelcoordinate.

In some embodiments, the results of a convolution operation are summedinto a single entry in a potential array. In FIG. 13 , the dotted boxesshow where filter 1304 convolutions take place over the inputs. Thesmaller dotted box in potential array 1309 for filter 1304 shows wherethese inputs are summed.

In FIG. 13 , the convolution operation performed by filter 1304 can bedescribed as a 3D dot product. The dotted box shows where filter 1304aligns with the input. The 3D dot product sums across x, y, and channeland places this scalar sum into a third matrix called a potential array(or an activation map). In FIG. 13 , potential array 1309 represents thepotential array for filter 1304. As would be appreciated by a person ofordinary skill in the art, each element of the potential array can beviewed as the membrane potential value of a neuron (e.g., spiking neuroncircuit).

In FIG. 13 , potential arrays 1309 and 1310 represent the potentialarrays corresponding to filters 1304 and 1305. The dotted box shows theresult of the current convolution. The dimensionality of a potentialarray can define the total number of neurons (e.g., spiking neuroncircuits). In FIG. 13 , filters 1304 and 1305 each simulate nineneurons. Each filter 1304 and 1305 can be centered at a different x-yposition within the three input channels. This example of convolution inFIG. 13 shows binary values for the elements in the input image and theweights in filter 1304 and 1305. However, as would be appreciated by aperson of ordinary skill in the art, the elements in the input image andthe weights in filter 1304 and 1305 can include positive and negativefloating-point values.

In some embodiments, discrete convolution can be performed usingEquation 1. In Equation 1, f can represent the input and g can representa filter (e.g., filter 1304). As would be appreciated by a person ofordinary skill in the art, Equation 1 is similar to calculating a dotproduct centered at a different image location for each value. However,as would be appreciated by a person of ordinary skill in the art, thefilter may need to be ‘flipped’ before being ‘slid’ over the input foreach dot product. The convolution operation may require the indices tobe flipped in the filter because it is a useful mathematical property.

$\begin{matrix}{( {f*g} ) = {\sum\limits_{m = {- \infty}}^{\infty}{{f\lbrack m\rbrack}{g\lbrack {n - m} \rbrack}}}} & (1)\end{matrix}$

In some embodiments, a stride of a convolutional layer can be defined ashow much a filter (e.g., 1304) is shifted between subsequent dot productoperations. In some embodiments, convolution stride can be hard-coded as1.

In FIG. 13 , filters 1304 and 1305 are not allowed to ‘stick out’ of theoriginal input image at all during the convolution operation. This typeof convolution can be referred to as ‘valid’ convolution. This type ofconvolution can result in a potential array (e.g., potential arrays 1309and 1310) that is smaller than the original input.

FIG. 14 illustrates the result of eight directional filter neuronconvolutions being applied to an input image, according to someembodiments. In FIG. 14 , input image 1401 containing a cat with asingle channel is converted to a spike map that has the same width andheight dimensions as the original image, with channels 1402, 1403, 1404,1405, 1406, 1407, 1408, and 1409.

FIG. 15 illustrates the similarity between DVS spike-based convolutionand frame-based convolution, according to some embodiments. Frames canrefer to the frames that are transmitted by a standard video camera.Events (or spikes) are transmitted by spike- or event-based cameras.Event-based convolution can perform a convolution operation at eachevent (or spike) and places the result in the output membrane potentialarray. Frame-based convolution 1502 shows a classical frame-basedconvolution where convolution is performed over the full image. Theparameters and result of the convolution are shown. Event-basedconvolution 1504 shows an event-based convolution operation where anevent (or spike) at (3, 3) is processed at time 0 nanoseconds (ns), thenan event at (2, 3) is processed at time 10 ns, then another event at (3,3) is processed at 20 ns, and finally an event at (3, 2) is processed at30 ns. The resulting array after each event is processed is shown abovethe kernel. The final result is the same.

FIG. 16 illustrates an example of a YAML configuration file 1600,according to some embodiments. YAML files can be a feature of the Pythonprogramming language. In some embodiments, YAML configuration file 1600can be used to program a neuromorphic integrated circuit and initializeit to process events (or spikes) in a defined application. An event isindicated by the occurrence of a spike and may indicate a colortransform in an image, an increase or decrease in a measured analogvalue, a change of contrast, the occurrence of specific data in a datapacket, or other real-world phenomenon.

In some embodiments, the neuromorphic integrated circuit, or a softwaresimulation thereof, is configured by YAML configuration file 1600 toprocess the CIFAR10 data set in a SCNN with eight distinct neurallayers. The first layer (layer 1602) is configured as an input layerwith a 32 by 32-bit organization to match the resolution of the dataset. This layer can convert pixel information to spikes and is connectedto layer 1604.

Layer 1604 is configured as a convolutional layer with tertiary synapticweights. Layer 1604 is defined as “ConvolutionalTertiary” layer type.Weights can be pre-loaded into layer 1604 from a file called“scnn_conv2_wts.dat” that is present in a specified directory. Layer1604 is defined to use a ‘FlushingBuffer.’ ‘FlushingBuffer’ can bedefined elsewhere in YAML configuration file 1600. The spike packet sizefor layer 1604 is defined as 131,072 spikes. This can be equivalent toone entire frame of 32 by 32 pixels with a depth of 8. Layer 1604 isdefined to have 128 outputs to the next layer (e.g., layer 1606). Layer1604 is defined to have a convolution size of 3 by 3 pixels with poolingacross a 2×2 field.

Each convolutional layer in the SCNN can be similarly configured. Thelast layer can be of type “FullyConnectedTernary” which indicates thatthe layer is a fully connected layer with tertiary synaptic weights.This last layer can have ten outputs. This can be equivalent to the tenclasses that are contained in the CIFAR10 data set. The last layer canhave a packet size 1024. This can be equivalent to the number offeatures that are returned in a previous convolutional layer.

In some embodiments, YAML configuration file 1600 can be processedduring the initialization of the neuromorphic integrated circuit. Aconstructor task can generate a Parameters object from the parametersspecified in YAML configuration file 1600. The constructor task canallocate a single layer for each parameter object in YAML configurationfile 1600. Each layer can be created with its specific parameters. Adata structure can be used to sequentially iterate through all layers. Abuffering type object can be created and initialized for each layer inthe SCNN. Each layer can be initialized and connected to previous layersthrough registers that are organized as a scan chain, except for theinput layer, which can be connected to input signals and outputs to thenext layer. During layer initialization, a connection list, a weightvector array, and a potential array are initialized. The connection listcan contain information about which neuron circuits are connected. Eachneuron circuit in the SCNN can have a defined number of synapses, whichcontain synaptic weight values. The membrane potential value of eachneuron can be defined as the sum of all synapse weight vectors that areconnected to that neuron circuit and are designated by a spike in aspike packet.

FIG. 17 illustrates configuration registers comprising a scan chain thatdefine a configuration and connectivity of each neuron circuit and eachlayer of neurons circuits, according to some embodiments. FIG. 17illustrates configuration registers comprising a scan chain that definea configuration and connectivity of each neuron circuit and each layerof neuron circuits, according to some embodiments. Configuration datacan be sent in a sequential manner to the neural processors to constructa processing sequence.

What is claimed is:
 1. A neuromorphic integrated circuit, comprising: aspike converter configured to generate spikes from input data; a spikeinput buffer configured to store the spikes from the spike converter; aneuron fabric comprising a neural processor comprising a plurality ofspiking neuron circuits configured to perform a task based on the spikesand a neural network configuration; a memory comprising the neuralnetwork configuration, wherein the neural network configurationcomprises a potential array and a plurality of synapses, the neuralnetwork configuration defines connections between the plurality ofspiking neuron circuits and the plurality of synapses, the potentialarray comprising membrane potential values for the plurality of spikingneuron circuits, and the plurality of synapses having correspondingsynaptic weights; a packetizer configured to generate a spike packetcomprising spike bits representing the spikes in the spike input buffer,wherein each spike bit in the spike packet corresponds to a synapse inthe plurality of synapses; and a processor configured to modify theneural network configuration based on a plurality of configurationparameters, wherein a spiking neuron circuit in the plurality of spikingneuron circuits is configured to: apply a first logical AND function toa first spike bit in the spike packet and a first synaptic weight of afirst synapse corresponding to the first spike bit, wherein the firstsynaptic weight has a value of one, and the applying the first logicalAND function outputs a logical one; and increment a membrane potentialvalue associated with the spiking neuron circuit in response to theapplying the first logical AND function outputting the logical one;apply a second logical AND function to the first spike bit in the spikepacket and a second synaptic weight corresponding to the first spikebit, wherein the second synaptic weight has a negative value, and theapplying the second logical AND function outputs a logical one;decrement the membrane potential value associated with the spikingneuron circuit in response to the applying the second logical ANDfunction outputting the logical one.
 2. The neuromorphic integratedcircuit of claim 1, wherein each synaptic weight of the synaptic weightshas a weight value selected from a group consisting of negative one,zero, and one.
 3. The neuromorphic integrated circuit of claim 1,wherein each spike bit in the spike packet is represented using adigital bit.
 4. The neuromorphic integrated circuit of claim 1, whereinthe neural processor is configured to: select a spiking neuron circuitin the plurality of spiking neuron circuits based on the spiking neuroncircuit having a membrane potential value that is a highest value amongthe membrane potential values for the plurality of spiking neuroncircuits; determine that the membrane potential value of the selectedspiking neuron circuit reached a learning threshold value associatedwith the spiking neuron circuit; and perform a learning function basedon the determination that the membrane potential value of the selectedspiking neuron circuit reached the learning threshold value associatedwith the selected spiking neuron circuit.
 5. The neuromorphic integratedcircuit of claim 4, wherein to perform the learning function the neuralprocessor is configured to: determine a first spike bit in the spikepacket represents an unused spike, wherein the first spike bitcorresponds to a first synapse in the plurality of synapses, the firstspike bit has a value of one, and a first synaptic weight of the firstsynapse has a value of zero; determine a second synaptic weight of asecond synapse in the plurality of synapses is an unused synapticweight, wherein the second synaptic weight corresponds to a second spikebit in the spike packet, the second synaptic weight has a value of one,and the second spike bit in the spike packet has a value of zero;swapping a value of the second synaptic weight with a value of the firstspike.
 6. The neuromorphic integrated circuit of claim 1, wherein aspiking neuron circuit in the plurality of spiking neuron circuits isconfigured to: determine that a membrane potential value associated withthe spiking neuron circuit reached a spiking threshold value of thespiking neuron circuit; and generate an output spike based on thedetermination that the membrane potential value of the spiking neuroncircuit reached the spiking threshold value.
 7. The neuromorphicintegrated circuit of claim 1, wherein the neuron fabric is configuredto perform the task using a convolution operation.
 8. The neuromorphicintegrated circuit of claim 1, wherein to modify the neural networkconfiguration the processor is configured to modify the connectionsbetween the plurality of spiking neuron circuits and the plurality ofsynapses based on the configuration parameters.
 9. The neuromorphicintegrated circuit of claim 1, wherein the input data comprises pixeldata, audio data, or sensory data.
 10. The neuromorphic integratedcircuit of claim 1, the neuromorphic integrated circuit furthercomprising a plurality of sensor interfaces.
 11. A method, comprising:receiving, at a spiking neuron circuit, a set of spike bitscorresponding to a set synapses associated with the spiking neuroncircuit; applying, at the spiking neuron circuit, a first logical ANDfunction to a first spike bit in the set of spike bits and a firstsynaptic weight of a first synapse in the set of synapses, wherein thefirst synapse corresponds to the first spike bit; incrementing, at thespiking neuron circuit, a membrane potential value associated with thespiking neuron circuit based on the applying; applying, at the spikingneuron circuit, a second logical AND function to the first spike bit inthe set of spike bits and a second synaptic weight of a second synapsein the set of synapses, wherein the second synapse corresponds to thefirst spike bit, the second synaptic weight has a value of negative one,and the applying the second logical AND function outputs a logical one;and decrementing, at the spiking neuron circuit, the membrane potentialvalue associated with the spiking neuron circuit in response to theapplying the second logical AND function outputting the logical one. 12.The method of claim 11, wherein the set of spike bits represent inputdata comprising pixel data, audio data, or sensory data.
 13. The methodof claim 11, further comprising: selecting, by the neural processor, thespiking neuron circuit from a plurality of spiking neuron circuits basedon the membrane potential value of the spiking neuron circuit having ahighest value among membrane potential values for the plurality ofspiking neuron circuits.
 14. The method of claim 11, further comprising:determining, at a neural processor, that the membrane potential valueassociated with the spiking neuron circuit reached a learning thresholdvalue associated with the spiking neuron circuit; and performing, at theneural processor, a learning function based on the determination thatthe membrane potential value of the spiking neuron circuit reached thelearning threshold value associated with the spiking neuron circuit.